<?php
header('Content-Type:application/json;charset=utf8');
@$uname=$_REQUEST['uname'] or die('{"code":2,"msg":"uname required"}');
require('init.php');
$sql="insert into register values(null,'$uname','$upwd')";
$result =mysqli_query($conn,$sql);
if($result===false){
      $output['code']=5;
      $output['msg']='insert err';
      $output['sql']=$sql;
    }else{
      $output['code']=1;
      $output['uid']=mysqli_insert_id($conn);
    }
  echo json_encode($output);